package com.example.springboot_vue.controller;


import com.example.springboot_vue.common.CommonDto;
import com.example.springboot_vue.entity.Menu;
import com.example.springboot_vue.req.UserEntityReq;
import com.example.springboot_vue.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author sgp
 * @since 2024-07-18
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/list")
    public CommonDto findByRoleId(String roleId){
        CommonDto<List<Menu>> commonDto = new CommonDto<>();
        List<Menu> list= menuService.findByRoleId(roleId);
        commonDto.setContent(list);
        return commonDto;
    }

}
